/* console.log(process.cwd())
console.log(process.memoryUsage()) */


/* function read() {
    setImmediate(() => {
        console.log(1)
        process.nextTick(() => {
            console.log(2)
            process.nextTick(() => {
                console.log(3)
                process.nextTick(() => {
                    console.log(4)
                    process.nextTick(() => {
                        console.log(5)
                        setImmediate(() => {
                            console.log(6)
                        })
                    })
                })
            })
        })
    });
    process.nextTick(() => {
        console.log(0)
    })
}
read(); */

/* const util = require('util');
const EventEmitter = require('events');

// console.log(util)
function Bell() {
    // 继承私有属性
    EventEmitter.call(this);
}

// 继承公用的方法
util.inherits(Bell,EventEmitter);

let bell = new Bell();

function sudentInClassroom() {
    console.log('学生进教室')
}
function teacherInClassroom() {
    console.log('教师进教室')
}
bell.on('响',sudentInClassroom);
bell.on('响',teacherInClassroom);

bell.emit('响') */

/* let buf1 = Buffer.alloc(6,20);
console.log(buf1) // <Buffer 14 14 14 14 14 14>

let buf2 = Buffer.allocUnsafe(30);
console.log(buf2) // <Buffer 18 a9 dd 6b e1 01 00 00 88 a9 dd 6b e1 01 00 00 08 aa dd 6b e1 01 00 00 a0 aa dd 6b e1 01>

let buf3 = Buffer.from('buffer');
console.log(buf3) // <Buffer 62 75 66 66 65 72> */

/* let buf3 = Buffer.alloc(7)
buf3.fill(3,2,5)
console.log(buf3) */

/* let buf4 = Buffer.alloc(5);
buf4.writeInt8(16,0)
console.log(buf4) */

/* let { StringDecoder } = require('string_decoder');
let s = new StringDecoder;
let buf5 = Buffer.from('我爱我家')

let buf6 = buf5.slice(0,5)
let buf7 = buf5.slice(5)


console.log(buf6.toString(),buf7.toString())
console.log(s.write(buf6),s.write(buf7)) */


/* let buf8 = Buffer.from('中')
let buf9 = Buffer.from('国')

let list = [buf8,buf9];

let len = list.reduce((len,item) => {
    return len + item.length
},0);
console.log(len) */

/* Buffer.concat1 = function(list,total = list.reduce((len,item) => len + item.length,0)) {
    if(list.length == 1) {
        return list[0];
    };
    let index = 0,
        result = Buffer.alloc(total);
    for(let bf of list) {
        for(let b of bf) {
            if(index >= total) {
                return result
            }else{
                result[index++] = b;
            }
        }
    };
    return result;
} 

let result = Buffer.concat1([buf8,buf9])

console.log(result);*/
/* 
let fs = require('fs');
let { resolve } = require('path');
let dirPos = dir => resolve(__dirname,dir);
console.time('no')
fs.readFile(dirPos('./1.txt'),(err,data) => err ? console.log(err) : console.log(data.toString()))
console.timeEnd('no')
console.time('pars')
fs.readFile(dirPos('./1.txt'),{encoding: 'utf8',flag: 'r'},(err,data) => console.log(data))
console.timeEnd('pars') */


/* const { basename, extname } = require('path');
console.log(new Date()) */

let d = '@b:msg';

let a = d.split(':'),
    toU = a[0].slice(1), msg = a[1];
console.log(toU,msg)